package com.weiyi.portal.config;

import com.weiyi.portal.modules.ums.service.UmsMemberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.core.userdetails.UserDetailsService;
import weiyi.security.config.SecurityConfig;

@Configuration
@EnableWebSecurity
public class MallSecurityConfig extends SecurityConfig {
    @Autowired
    UmsMemberService umsMemberService;

    @Bean
    public UserDetailsService userDetailsService(){
        return name -> umsMemberService.loadUserByUserName(name);
    }
}
